package com.ssyx.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ssyx.model.product.AttrGroup;
import com.ssyx.product.service.AttrGroupService;
import com.ssyx.product.mapper.AttrGroupMapper;
import com.ssyx.vo.product.AttrGroupQueryVo;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.lang.invoke.VarHandle;

/**
* @author 34901
* @description 针对表【attr_group(属性分组)】的数据库操作Service实现
* @createDate 2024-04-27 23:24:27
*/
@Service
public class AttrGroupServiceImpl extends ServiceImpl<AttrGroupMapper, AttrGroup>
    implements AttrGroupService{

    //平台属性分组列表
    @Override
    public IPage<AttrGroup> getPage(Page<AttrGroup> pageParams, AttrGroupQueryVo attrGroupQueryVo) {

        String name = attrGroupQueryVo.getName();
        LambdaQueryWrapper<AttrGroup> wrapper = new LambdaQueryWrapper<>();
        if(!StringUtils.isEmpty(name)){
            wrapper.like(AttrGroup::getName,name);
        }
        IPage<AttrGroup> attrGroupPage = baseMapper.selectPage(pageParams, wrapper);
        return attrGroupPage;
    }

}




